<template>
	<view class="audit-box">
		<bsNavBar title='会员认证'></bsNavBar>
		<view class="">
			<image class="icon" :src="imgUrl+'duihao.png'" mode=""></image>
			<view class="title">
				审核通过
			</view>
			<view class="content-text">
				您的资料已通过审核，请尽快完成缴费
			</view>
			<view class="pic">
				缴费金额：<text class="pic-num">{{price}}元</text>
			</view>
			<u-button type="jz" ripple="" @click="handPay">立即缴费</u-button>
		</view>
	</view>
</template>

<script>
	import {
		subPay
	} from '@/utils/tools.js'
	export default {
		data() {
			return {
				imgUrl: this.configImgUrl,
				price: ''
			};
		},
		onLoad(e) {
			console.log(e)
			this.vipTypeId = e.vipTypeId
			this.price = e.price
		},
		methods: {
			async handPay() {
				let res = await this.$u.api.vipPay({
					vipId: this.vipTypeId,
					flag: 3
				})
				console.log(res.paramMap)
				try {
					let pay = await subPay(res.paramMap)
					uni.navigateTo({
						url: '/pages/my/authVip/auth'
					})
				} catch (e) {
					uni.showToast({
						title: '取消支付',
						icon: 'none'
					})
				}

				// uni.navigateTo({
				// 	url: '/pages/my/authVip/paySucceed'
				// })
			}
		}
	}
</script>

<style lang="scss" scoped>
	.audit-box {
		text-align: center;
		padding: 226rpx 100rpx;

		.pic {
			margin-bottom: 36rpx;
			color: #666666;
			font-size: 32rpx;

			.pic-num {
				font-weight: bold;
				color: red;
			}
		}

		.title {
			margin: 40rpx 0 20rpx 0;
			font-size: 36rpx;
			color: $bs-text-color-333;
			font-weight: bold;
		}

		.content-text {
			margin-bottom: 80rpx;
			color: #666666;
			font-size: 32rpx;
		}

		.icon {
			width: 130rpx;
			height: 130rpx;
		}
	}
</style>
